all.spec.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
c 2
b 0
f 0
nc 2
dl 0
loc 7
rs 9.4285
nop 0
1
'use strict'
2
3
import { describe, it } from 'mocha'
4
import { expect } from 'chai'
5
import restify from 'restify'
6
import endpoints from '.'
7
8
const server = restify.createServer()
9
server.get('/hello/:name', (req, res, next) => next())
10
11
/* eslint-disable no-undef */
12
describe('endpoints: helpers', () => {
13
  context('.all', () => {
14
    it('Should throw exception if server is not provided', () => {
15
      try {
16
        endpoints.listAll()
17
      } catch (error) {
18
        expect(error.code).to.be.equal('ERR_ASSERTION')
19
      }
20
    })
21
    it('Should not return empty', () => {
22
      const output = endpoints.listAll(server)
23
      expect(output).to.be.not.undefined()
24
      expect(output).to.be.not.null()
25
    })
26
  })
27
})
28